package cn.tangsihai.feign.client;

import cn.tangsihai.domain.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * feign接口类
 */

// fallbackFactory：接口熔断，指定降级接口
// FeignClient：集成Feign
@FeignClient(value = "SERVICE-USER", fallbackFactory = UserFeignClientFallbackFactory.class)
public interface StoreClient {
    @GetMapping("/getById/{id}")
    User getId(@PathVariable("id") Long id); // 注必须与要集成的方法一致，只是这里是抽象
}
